<style type="text/css">
.fui-header a.back:before {
	border-color: #fff;
}
.fui-header:after {
	height: 0;
	border-bottom: 0 solid #D9D9D9;
}
</style>
<div class="fui-page order-create-page fui-page-current" ng-if="pagedata.op == 'main'">
	<div class="topbg" style="position: relative;text-align:center;width:100%;min-height:4.5rem;background: {{main.syscolor || '#ff9d55'}};border-bottom-right-radius:1rem;">
	 <div class="fui-header" style="background:none">
		<div class="fui-header-left" ng-click="goback()">
            <a class="back" style="color:#fff"></a>
        </div>
		<div class="title bold" style="color:#fff">{{pagedata.hotel.title}}</div>
		<div class="fui-header-right"></div>
	</div>
		<div class="fe-floatback" style="top:2.3rem;position: absolute;width: 10rem;padding:0.3rem 0.2rem;left:50%;margin-left:-5rem;height:1.6rem;border-radius:1.6rem;background-color: #333;color: #fff;line-height: 0.8rem;opacity: 0.6;">
			<div class="overflow-h" style="width:10rem;line-height:1rem;font-size:0.6rem;"><i class="icon icon-position" style="font-size:0.6rem"></i> {{pagedata.hotel.address || '未定义地址'}}</div>
		</div>
		<div id="carousel-container" class="carousel slide" data-role="carousel" data-param-auto="true">
				<div class="carousel-inner" role="listbox" style="height:auto">
					<div ng-class="{'item':1,'active':$index==0}" ng-repeat="item in pagedata.room.images">
						<a>
							<img src="{{tomedia(item) || '../core/resource/images/banner-1.jpg'}}" style="display: block; width: 100%; height: 10rem;">
						</a>
					</div>
				</div>
					<style>
							.fui-swipe-page .fui-swipe-bullet {background: {background}; opacity: {opacity};}
							.fui-swipe-page .fui-swipe-bullet.active {opacity: 1;}
					</style>
					<div id="carousel-jinyun" class="fui-swipe-page" style="padding: 0 5px; bottom: 10px; ">
						<div class="fui-swipe-bullet" ng-repeat="item in pagedata.room.images" ng-class="{'active':$index==0}" data-target="#carousel-container" data-slide-to="{{$index}}"></div>
					</div>
		</div>
	</div>
	<div class="fui-content" style="padding:0.6rem;padding-bottom:4.6rem;margin-top:-0.6rem;z-index:108;border-top-left-radius:1rem;">
		<div class="weui_cells" style="margin-top:0.6rem">
			<div class="weui_cells_title bold">
			 房间信息
			</div>
			<div class="fui-cell-group" style="margin-top:0;">
            <div class="fui-cell">
                <div class="fui-cell-label" style="width:auto"><img style="width:3rem;height:3rem;margin-right:5px;display:block" ng-src="{{tomedia(pagedata.room.image) || '../core/resource/images/nopic.jpg'}}"/></div>
                <div class="fui-cell-text">
					<div style="width:100%">
                    <span>{{pagedata.room.title}}</span>
					<span style="font-size:0.6rem;color:#999">{{pagedata.room.mianji}}平米 {{item.chuang}}</span>
					</div>
					<div class="subtitle"><span>{{pagedata.room.ttitle}}</span></div>
					<div class="subtitle"> ￥<span style="width:100%;color:red;font-size:1rem">{{pagedata.room.tprice || '0.00'}}</span> /间</div>
				</div>
                <div ng-if="pagedata.room.breakfast==1" class="fui-cell-remark noremark">含早</div>
				<div ng-if="pagedata.room.breakfast!=1" class="fui-cell-remark noremark">不含早</div>
            </div>
			<div class="fui-cell-group" style="margin-top:0;">
				<div ng-include="sys_html('common/_setroom')"></div>
			</div>
        </div>
		<div class="weui_cells">
		<div class="weui_cells_title bold">
			 入住信息
		</div>
		<div class="weui_cell weui_cell_select weui_select_after">
                <div class="weui_cell_hd">
                    房间数
                </div>
                <div class="weui_cell_bd weui_cell_primary">
                    <select class="weui_select" name="select2" ng-change="pagedata.upprice();" ng-model="pagedata.post.num">
                        <option value="1" ng-selected="pagedata.post.num==1">1间</option>
                        <option value="2" ng-selected="pagedata.post.num==2">2间</option>
                        <option value="3" ng-selected="pagedata.post.num==3">3间</option>
						<option value="4" ng-selected="pagedata.post.num==4">4间</option>
						<option value="5" ng-selected="pagedata.post.num==5">5间</option>
                    </select>
                </div>
        </div>
		<div class="weui_cell weui_cell_select weui_select_after">
                <div class="weui_cell_hd">
                    保留至
                </div>
                <div class="weui_cell_bd weui_cell_primary">
                    <select class="weui_select" name="select2" ng-model="pagedata.post.shike">
                        <option value="15:00">15:00</option>
                        <option value="16:00">16:00</option>
                        <option value="17:00">17:00</option>
						<option value="18:00">18:00</option>
						<option value="19:00">19:00</option>
						<option value="20:00">20:00</option>
						<option value="21:00">21:00</option>
						<option value="22:00">22:00</option>
                    </select>
                </div>
        </div>
		<div class="weui_cell">
                <div class="weui_cell_hd"><label class="weui_label">入住人(房间1)</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input ng-model="pagedata.post.name" class="weui_input" type="text" placeholder="姓名，每间填1人">					
                </div>
        </div>
		<div ng-if="pagedata.post.num >= 2" class="weui_cell">
                <div class="weui_cell_hd"><label class="weui_label">入住人(房间2)</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input ng-model="pagedata.post.name2" class="weui_input" type="text" placeholder="姓名，每间填1人">					
                </div>
        </div>
		<div ng-if="pagedata.post.num >= 3" class="weui_cell">
                <div class="weui_cell_hd"><label class="weui_label">入住人(房间3)</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input ng-model="pagedata.post.name3" class="weui_input" type="text" placeholder="姓名，每间填1人">					
                </div>
        </div>
		<div ng-if="pagedata.post.num >= 4" class="weui_cell">
                <div class="weui_cell_hd"><label class="weui_label">入住人(房间4)</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input  class="weui_input" type="text" placeholder="姓名，每间填1人">					
                </div>
        </div>
		<div ng-if="pagedata.post.num >= 5" class="weui_cell">
                <div class="weui_cell_hd"><label class="weui_label">入住人(房间5)</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input  class="weui_input" type="text" placeholder="姓名，每间填1人">					
                </div>
        </div>
		<div class="weui_cell weui_cell_select weui_select_before">
                <div class="weui_cell_hd">
                    <select class="weui_select" name="select2">
                        <option value="1">+86</option>
                        <option value="2">+80</option>
                        <option value="3">+84</option>
                        <option value="4">+87</option>
                    </select>
                </div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input ng-model="pagedata.post.mobile" class="weui_input" type="number" pattern="[0-9]*" placeholder="请输入号码">
                </div>
        </div>
		</div>
		<div class="weui_cells_title">
			<p style="color:#19b955"><i class="icon icon-information"></i> {{pagedata.diy_text01}}</p>
		</div>
		<div class="weui_cells_title">
			<p style="color:#19b955"><i class="icon icon-information"></i> {{pagedata.diy_text02}}</p>
			<p ng-if="pagedata.room.is_opentui==1">
			{{pagedata.diy_text03}}
			</p>
		</div>
		
</div>
<div class="fui-navbar-tip" style="height:1.8rem;padding-top:0.4rem">
<label class="checkbox-inline">
<input type="checkbox" class="fui-checkbox-primary" ng-click="pagedata.post.check=1" id="agree" ng-checked="pagedata.post.check==1"/> 我已经阅读并了解了<a ng-click="pagedata.show_xieyi=true" class="syscolor">【{{pagedata.xieyi.title||'订房须知'}}】</a>
</label>
</div>
<div class="fui-footer quick">
	<div class="quick-info">
		<span class="price" id="cart-price" style="line-height:2.0rem">￥{{price(pagedata.post.allprice)}} <span style="color:#999;font-size:0.6rem">（押金{{price(pagedata.post.yaprice)}}）</span></span>
	</div>
	<div ng-if="!pagedata.orderid" class="quick-submit" href="javascript:" ng-click="pagedata.gopay()" style="margin: 0;background:{{main.syscolor || '#ff9d55'}}">确认下单</div>
	<div ng-if="pagedata.orderid" class="quick-submit" href="javascript:" ng-click="access_json('jy_jd/order/')" style="margin: 0;background:{{main.syscolor || '#ff9d55'}}">查看订单</div>
</div>
</div>
<div ng-if="pagedata.show_xieyi" class="popup">
	<div class="popup-body">
		<div class="popup-center">
			<i class="closed icon icon-cuowu" style="font-size:1.2rem;top:105%;" ng-click="pagedata.show_xieyi=false"></i>
			<div class="content-images" style="padding:0.5rem;height:20rem; overflow-y:scroll;">
					<div class="title bold" style="font-size:0.8rem">{{pagedata.xieyi.title||'订房须知'}} / <small>Read Ggree</small></div>
					<div class="text" style="padding-top:0.5rem;font-size:0.7rem" ng-bind-html="trust(pagedata.xieyi.content)">
					</div>
			</div>
			<div class="modal-footer">
				<div ng-click="pagedata.show_xieyi=false;pagedata.post.check=1" class="mod-check" style="width: 100%; margin: 0;">我已阅读</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
scope.pagedata.isupprice=true;
scope.pagedata.upprice = function(){
	scope.post_json('/create/upprice/',scope.pagedata.post,function(res){
		console.log(res);
		scope.pagedata.post.yaprice=res.yaprice;
		scope.pagedata.post.allprice=res.allprice;
		scope.$evalAsync();
	});	
}
</script>
<script>
scope.pagedata.gopay=function(){
	scope.post_json('/create/post/',scope.pagedata.post,function(res){
			if(res.payid){
				scope.pagedata.orderid=res.orderid
				scope.$evalAsync();
				require(['tool'],function(tool){
					tool.pay(res.payid,function(res){
						if(res.type=='success'){
							scope.message('支付成功！','','jy_jd/order/');
							
						}else{
							scope.message('支付失败！','','goback');
						}
					},'','','jy_jd/order/','jy_jd/order/');
				});
			}
	});
	return
}
	require(['bootstrap', 'hammer'], function($, Hammer){
		$('#carousel-container').carousel();
		var mc = new Hammer($('#carousel-container').get(0));
		mc.on("panleft", function(ev) {
			$('#carousel-container').carousel('next');
		});
		mc.on("panright", function(ev) {
			$('#carousel-container').carousel('prev');
		});
	});
</script>